/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package isnmp.ui;

import isnmp.ui.dto.CPUInfo;
import isnmp.ui.dto.DeviceInfo;
import isnmp.ui.dto.MachineInfo;
import isnmp.ui.dto.NetworkInfo;
import isnmp.ui.dto.ProgramInfo;
import isnmp.ui.dto.StorageInfo;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import javax.swing.tree.DefaultMutableTreeNode;
import sg.simple.snmp.provider.NetMapException;


public class ChildDevice extends DefaultMutableTreeNode {
    
    	private  List<CPUInfo> cpuInfoList = new ArrayList<CPUInfo>();
	private  List<StorageInfo> storageInfoList = new ArrayList<StorageInfo>();
	private  List<ProgramInfo> programInfoList = new ArrayList<ProgramInfo>();
	private  List<NetworkInfo> networkInfoList = new ArrayList<NetworkInfo>();
        private  List<DeviceInfo> deviceInfoList = new ArrayList<DeviceInfo>();
        private  MachineInfo machineInfo = null;

    public MachineInfo getMachineInfo() {
        return machineInfo;
    }

    public void setMachineInfo(MachineInfo machineInfo) {
        this.machineInfo = machineInfo;
    }

    private static Logger logger = Logger.getLogger("ChildDevice");
    String ip;

	public static enum ChildActionEnum {
		Restart, Shutdown, Block
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String toString() {
		return ip;
	}

    public void restart() throws NetMapException
    {
		logger.info("restarting" + ip);
		NetMapManager.getSimpleSNMPQueries().restartMachine(ip);
	}

    public void shutdown() throws NetMapException
    {
		NetMapManager.getSimpleSNMPQueries().shutdownMachine(ip);

	}

    public void block() throws NetMapException
    {
		NetMapManager.getSimpleSNMPQueries().blockMachine(ip);
	}

    public List<CPUInfo> getCpuInfoList() {
        return cpuInfoList;
    }

    public void setCpuInfoList(List<CPUInfo> cpuInfoList) {
        this.cpuInfoList = cpuInfoList;
    }

    public List<DeviceInfo> getDeviceInfoList() {
        return deviceInfoList;
    }

    public void setDeviceInfoList(List<DeviceInfo> deviceInfoList) {
        this.deviceInfoList = deviceInfoList;
    }

    public List<NetworkInfo> getNetworkInfoList() {
        return networkInfoList;
    }

    public void setNetworkInfoList(List<NetworkInfo> networkInfoList) {
        this.networkInfoList = networkInfoList;
    }

    public List<ProgramInfo> getProgramInfoList() {
        return programInfoList;
    }

    public void setProgramInfoList(List<ProgramInfo> programInfoList) {
        this.programInfoList = programInfoList;
    }

    public List<StorageInfo> getStorageInfoList() {
        return storageInfoList;
    }

    public void setStorageInfoList(List<StorageInfo> storageInfoList) {
        this.storageInfoList = storageInfoList;
    }

    
    
}
